package com.sands.ui;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Toast;

import com.sands.R;
import com.sands.network.apihelper.AppNormalHelper;

import rx.functions.Action1;

public class Activity_Test extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity__test);
    }

    public void test(View view) {
        switch (view.getId()) {
            case R.id.test1:
                AppNormalHelper.normal_wx_news(1)
                        .subscribe(new Action1<String>() {
                                       @Override
                                       public void call(String s) {
                                           com.sands.utils.Toast.show(s, Toast.LENGTH_LONG);

                                       }
                                   }, new Action1<Throwable>() {
                                       @Override
                                       public void call(Throwable throwable) {
                                           com.sands.utils.Toast.show(throwable.getMessage(), Toast.LENGTH_LONG);
                                       }
                                   }
                        );
                break;

        }

    }
}
